package com.cennavi.mineplay.mineplay_data.bean;

import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;

public class LinkBean {
    private String linkId;
    private String kind;
    private int fc;
    private int dir;
    private double length;
    private LineString line;
    private WKTReader reader = new WKTReader(new GeometryFactory());


    public String getLinkId() {
        return linkId;
    }

    public void setLinkId(String linkId) {
        this.linkId = linkId;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public int getFc() {
        return fc;
    }

    public void setFc(int fc) {
        this.fc = fc;
    }

    public int getDir() {
        return dir;
    }

    public void setDir(int dir) {
        this.dir = dir;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public LineString getLine() {
        return line;
    }

    public void setLine(LineString line) {
        this.line = line;
    }



    public LinkBean(String linkId, String wkt) {
        try {
            this.line = (LineString) reader.read(wkt);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
